package blog.spring.web.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import blog.spring.db.entity.Comment;
import blog.spring.db.service.ICommentService;

@Controller
@RequestMapping("comment")
public class CommentController extends BlogController {

	public static String CURRENT_DIR = "comment";
	@Resource
	private ICommentService commentService;

	public CommentController() {
		super(CURRENT_DIR);
	}

	/***************** 获取热门文章列表 *****************/
	@RequestMapping(value = "/new", method = RequestMethod.GET)
	public @ResponseBody List<Comment> hot(ModelMap map) {
		return commentService.findNew(5);
	}
}
